package de.hhkk.view;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;

public class UIStammdatenKunde extends Composite
{
    private Text  text;
    private Text  text_1;
    private Table table;
    private Text  text_2;

    /**
     * Create the composite.
     * @param parent
     * @param style
     */
    public UIStammdatenKunde(Composite parent, int style, String title)
    {
        super(parent, style);
        setLayout(new GridLayout(1, false));

        SashForm sashForm = new SashForm(this, SWT.VERTICAL);
        sashForm.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1));
        sashForm.setLocation(0, 0);

        Composite compSuchkriterien = new Composite(sashForm, SWT.NONE);
        compSuchkriterien.setLayout(new GridLayout(4, false));

        Label lblNewLabel = new Label(compSuchkriterien, SWT.NONE);
        lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        lblNewLabel.setText("Kunden-Nr.");

        text = new Text(compSuchkriterien, SWT.BORDER);
        text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

        Label lblNewLabel_1 = new Label(compSuchkriterien, SWT.NONE);
        lblNewLabel_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        lblNewLabel_1.setText("Vorname");

        text_1 = new Text(compSuchkriterien, SWT.BORDER);
        text_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

        Label lblNachname = new Label(compSuchkriterien, SWT.NONE);
        lblNachname.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
        lblNachname.setText("Nachname");

        text_2 = new Text(compSuchkriterien, SWT.BORDER);
        text_2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

        Label lblTyp = new Label(compSuchkriterien, SWT.NONE);
        lblTyp.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        lblTyp.setText("Typ");

        Combo combo = new Combo(compSuchkriterien, SWT.NONE);
        combo.setItems(new String[]{"Firma", "Privatperson", "Resiseb\u00FCro"});
        combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

        Composite compTrefferliste = new Composite(sashForm, SWT.NONE);
        compTrefferliste.setSize(64, 64);
        compTrefferliste.setLayout(new GridLayout(10, false));
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);
        new Label(compTrefferliste, SWT.NONE);

        Button btnNewButton = new Button(compTrefferliste, SWT.NONE);
        btnNewButton.setText("Suchen");
        sashForm.setWeights(new int[]{1, 1});
        new Label(this, SWT.NONE);

        table = new Table(this, SWT.BORDER | SWT.FULL_SELECTION);
        table.setHeaderVisible(true);
        table.setLinesVisible(true);

        TableColumn tblclmnNewColumn = new TableColumn(table, SWT.NONE);
        tblclmnNewColumn.setWidth(100);
        tblclmnNewColumn.setText("New Column");

        TableColumn tblclmnNewColumn_1 = new TableColumn(table, SWT.NONE);
        tblclmnNewColumn_1.setWidth(100);
        tblclmnNewColumn_1.setText("New Column");

        TableColumn tblclmnNewColumn_2 = new TableColumn(table, SWT.NONE);
        tblclmnNewColumn_2.setWidth(100);
        tblclmnNewColumn_2.setText("New Column");

        TableColumn tblclmnNewColumn_3 = new TableColumn(table, SWT.NONE);
        tblclmnNewColumn_3.setWidth(100);
        tblclmnNewColumn_3.setText("New Column");

    }

    @Override
    protected void checkSubclass()
    {
        // Disable the check that prevents subclassing of SWT components
    }
}
